<style lang="scss" scoped>
  // @import '@/assets/css/variable';
  .navbar{
    position: fixed;
	left: 12px;
	top: 12px;
	// width: 80px;
	padding: 6px 8px;
	z-index: 101;
	background-color: rgba($color: #cacaca, $alpha: 0.6);
	color: white;
	border-radius: 10px;
  }
</style>
<template>
  <div class="navbar flex align-center" ref="navbar" @click="onClickLeft">
	<van-icon name="arrow-left" />
	<span class="margL-s">返回</span>
    <!-- <van-nav-bar
        :title="title"
        left-text="返回"
        right-text="工作台"
        left-arrow
        @click-left="onClickLeft"
        @click-right="onClickRight"
      /> -->
  </div>
</template>
<script>
export default {
  components: {
  },
  props: {
    title: {
      type: String,
      default: ''
    },
	to: {
      type: String,
      default: ''
    },
  },
  data() {
    return {
      value: ''
    };
  },
  mounted() {
    // const navbarHeight = this.$refs.navbar.offsetHeight
    // console.log('navbarHeight',navbarHeight)
    // this.$store.commit('setNavbarHeight',navbarHeight)
  },
  methods: {
    onClickLeft() {
		if(this.to){
			this.$router.replace(`/${this.to}`)
		}else {
			this.$router.go(-1)
		}
      
    },
    onClickRight() {
      this.$router.push('/workbench')
    },
  },
};
</script>
